<?php

namespace app\common\model\xilujob;

use think\Cache;
use think\Model;
use traits\model\SoftDelete;

class InformType extends Model
{

    use SoftDelete;

    

    // 表名
    protected $name = 'xilujob_inform_type';
    
    // 自动写入时间戳字段
    protected $autoWriteTimestamp = 'int';
    const CACHE_KEY = 'job_inform_types';

    // 定义时间戳字段名
    protected $createTime = 'createtime';
    protected $updateTime = 'updatetime';
    protected $deleteTime = 'deletetime';

    // 追加属性
    protected $append = [

    ];




    public static function getAll() {
        $cacheKey = self::CACHE_KEY;
        $all = Cache::get($cacheKey);
        if(!$all) {
            $all = static::order('weigh')->select();
            Cache::set($cacheKey, $all, 3600);
        }
        return $all;
    }


}
